#include<iostream>
#include<unistd.h>
#include<signal.h>
using namespace std;
int main(){
    signal(SIGCHLD,SIG_IGN);//Set the processing action of SIGCHLD to SIG_SGN, and the 
                            //child process will not generate zombies or wait for the 
                            //parent process to recycle. The child process will be released directly.
    pid_t id = fork();
    if(id == 0){   //child
        cout << "my child:" << getpid() << "my parent" << getppid() << endl;
        sleep(5);
        exit(1);
    }//parent
    cout << "my parent:" << getpid() << endl;
    sleep(10);
    return 0;
}